from flask import render_template, Blueprint
from app.models import db,AvgMoneyCity,District

main = Blueprint('main',__name__)

@main.route("/")
def index():
    return render_template('main/index.html')

@main.route('/bar')
def bar():
    rs_gamc = AvgMoneyCity.query.all()
    return render_template('main/bar.html',rs_gamc=rs_gamc)

@main.route("/map")
def map():
    sql = "select name,nowConfirm,confirm from epidemic"
    epidemic = list(db.session.execute(sql))
    return render_template("main/map.html",epidemic=epidemic)

@main.route('/wordcloud')
def wordCloud():
    districts = District.query.all()
    return render_template('main/wordcloud.html',districts=districts)





